#pragma once

#include <sys/epoll.h>
#include <vector>
#include <mutex>

class Channel;
class Epoll
{
private:
    int m_epollfd = -1;
    static const int M_MAX_EVENTS = 100;
    epoll_event m_events[M_MAX_EVENTS];
    std::mutex m_mutex;

public:
    Epoll();
    ~Epoll();

    void update_channel(Channel *channel);
void remove_channel(Channel *channel);

        std::vector<Channel *> loop(int timeout = -1);
};